package com.wsoft.system.controller;

import com.wsoft.response.ResponseResult;
import com.wsoft.system.query.member.MemberOrgPostQuery;
import com.wsoft.system.query.resourse.MenuResourceRelationQuery;
import com.wsoft.system.query.resourse.ResourceInsertQuery;
import com.wsoft.system.service.ISysMenuResourceRelationService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 *  前端控制器
 * @author juiet
 * @since 2024年11月18日 17:14:28
 */
@RestController
@Tag(name = "菜单资源管理")
@RequestMapping("/sys/menuResourceRelation")
public class SysMenuResourceRelationController {
    @Resource
    private ISysMenuResourceRelationService menuResourceRelationService;
    public ResponseResult insert(@RequestBody @Valid MenuResourceRelationQuery query) {
        menuResourceRelationService.insertRelations(query);
        return ResponseResult.success("[sys.msg.success]");
    }
    @GetMapping("/get")
    public ResponseResult get(@RequestParam("menuId") Long menuId) {
        return ResponseResult.success(menuResourceRelationService.getRelations(menuId));
    }
}
